<div class="widgets">
    <ba-card title="">
        <div class="form col-sm-11">
            <div class="form-group row">
                <div class="col-sm-6">
                    <div class="input-group">
                        <span class="input-group-addon" id="sizing-addon2"><i class="fa fa-search"></i>搜索</span>
                        <input type="text" class="form-control" placeholder="search" aria-describedby="sizing-addon2" [(ngModel)]="searchText">
                    </div>
                </div>
            </div>
        </div>

        <div>
            <button class="btn btn-primary" (click)="onNew()">新增</button>
        </div>
    </ba-card>

    <ba-card title="">
        <user-detail [user]="selectedUser" (onVoted)="getUsers()" ></user-detail>
    </ba-card>

    <ba-card title="用户列表">
        <table class="table table-bordered table-hover">
            <thead>
                <th>ID</th>
                <th>名称</th>
                <th>电话</th>
                <th>邮箱</th>
                <th>登录名</th>
                <th>是否有效</th>
            </thead>
            <tbody>
                <tr *ngFor="let user of users" [class.selected]="user === selectedUser" (click)="onSelect(user)">
                    <td>
                        <span class="badge">{{user.user_id}}</span></td>
                    <td>{{user.user_name}} </td>
                    <td>{{user.user_mobile}}</td>
                    <td>{{user.user_email}}</td>
                    <td>{{user.login_username}}</td>
                    <td>{{user.status}}</td>
                </tr>
            </tbody>
        </table>
    </ba-card>
</div>

